Skip to content
This repository has been archived by the owner on Sep 8, 2022. It is now read-only.

Add PrependSign to BLS123-81 SigAug to enable signing with any pk prepended #48

Closed
wants to merge 1 commit into from

Conversation

freddiecoleman
Copy link

@freddiecoleman freddiecoleman commented Mar 7, 2022

type=feature
risk=low
impact=sev2

Hi, I'm implementing the Signer interface for BLS123-81 in Rosetta SDK and require the ability to sign with a public key that is not derived from the secret key.

I felt it would be cleaner/safer to add this new exported function instead of introducing a breaking change to Sign which currently derives a public key from the passed in secret key.

@mikelodder7
Copy link
Contributor

Thanks for the PR. Couldn't you just prepend the public key as part of the message and call sign? That way you would have to have this function at all.

@freddiecoleman
Copy link
Author

freddiecoleman commented Mar 11, 2022

Thanks for the PR. Couldn't you just prepend the public key as part of the message and call sign? That way you would have to have this function at all.

Sign automatically prepends a PK derived from the passed in SK so it would end up with two public keys prepended.

https://github.com/coinbase/kryptology/blob/master/pkg/signatures/bls/bls_sig/usual_bls.go#L214

Also SigBasic can't be used to do this as that has a different domain seperation tag.

@mikelodder7
Copy link
Contributor

We have this method NewSigBasicWithDst which does allow you to set the DST

@freddiecoleman
Copy link
Author

We have this method NewSigBasicWithDst which does allow you to set the DST

I hadn't noticed that and will give that a go. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants